Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhance] Modify the dtype of heatmap_weights to speed up the calculation #2486

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

Ginray
Copy link
Contributor

@Ginray Ginray commented Jun 26, 2023

Motivation

The default data type generated by np.ones is float64, which causes the data type of heatmap_weights to be float64 as well. Finally, it affects the efficiency of calculating KeypointMSELoss.

Modification

Modify the dtype of np.ones to speed up subsequent calculations.

Use cases (Optional)

We have verified on related configurations, such as configs/body_2d_keypoint/dekr/coco/dekr_hrnet-w32_8xb10-140e_coco-512x512.py, there is no accuracy problem after modification, and the performance is improved by about 1.5%

Environment information: Tesla V100, torch 2.0.0

Checklist

Before PR:

  • [√] I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • [√] Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • [√] Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • [√] New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • [√] The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • [√] CLA has been signed and all committers have signed the CLA in this PR.

@CLAassistant
Copy link

CLAassistant commented Jun 26, 2023

CLA assistant check
All committers have signed the CLA.

@Ben-Louis Ben-Louis changed the base branch from 1.x to dev-1.x June 26, 2023 13:47
@Tau-J Tau-J changed the title [Improve]Modify the dtype of heatmap_weights to speed up the calculation [Enhance] Modify the dtype of heatmap_weights to speed up the calculation Jun 26, 2023
@Ben-Louis Ben-Louis merged commit 6f7411c into open-mmlab:dev-1.x Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants